function [pb_raw]=find_pb_during_sitting(velP_ind,velM_ind)

pb_raw=velM_ind;
pb_raw(end-1)=0;
start_search=0;
end_search=0;
cnt=0;
ps_start_ind=[];
ps_end_ind=[];

for ind=2:length(pb_raw)-1
    if pb_raw(ind)==0 & start_search==0
        start_search=1;
    end
    if pb_raw(ind)==1 & start_search==1 & pb_raw(ind-1)==0 & velP_ind(ind)==0 & velP_ind(ind+1)==0
        cnt=cnt+1;
        ps_start_ind(cnt)=ind;
        start_search=0;
        end_search=1;
    end
    if pb_raw(ind)==0 & end_search==1;
        ps_end_ind(cnt)=ind;
        end_search=0;
    end
end


use_ind=ps_end_ind-ps_start_ind>10;
ps_start_ind=ps_start_ind(use_ind);
ps_end_ind=ps_end_ind(use_ind);


pb_raw=0*pb_raw;

for ind=1:length(ps_start_ind)
    pb_raw(ps_start_ind(ind):ps_end_ind(ind))=1;
end

    